package core;

import java.util.ArrayList;

public class SetReview {
    public ArrayList<Review> setRev = new ArrayList<Review>();

    public SetReview() {

    }
    
    public void addReview(Review r) {
        setRev.add(r);
    }
    
    public Review getNextReview(int i) {
        return setRev.get(i % setRev.size());
    }
    
    public int getNumOfReview() {
        return setRev.size();
    }
    
    public ArrayList<Review> getReviews() {
    	return setRev;
    }
    
    public void addReviewIfNotExists(Review r) {
    	if (!checkIfExists(r)) {
    		setRev.add(r);
    	}    	
    }
    
    public boolean checkIfExists(Review r) {
    	for (Review rev : setRev) {
    		if (r == rev) {
    			return true;
    		}
    	}
    	return false;
    }
}
